//
//  TalkModel.h
//  家校互通
//
//  Created by 姬鑫宇 on 15/5/14.
//  Copyright (c) 2015年 姬鑫宇. All rights reserved.
//

#import <Foundation/Foundation.h>

@class TalkRoomModel;

@interface TalkModel : NSObject

//--创建聊天室
+ (NSURLSessionDataTask *)createClazzChart:(void (^)(BOOL result,TalkRoomModel *roomList, NSError *error))block withToken:(NSString *)token andName:(NSString *)name andClassId:(NSInteger) classId andUserId:(NSString *) userId;
/**
 *  邀请加入聊天室(带推送)
 *  @param token   <#token description#>
 *  @param chartId <#chartId description#>
 *  @param userIds <#userIds description#>
 */
+ (NSURLSessionDataTask *)inviteJoinChart:(void (^)(BOOL result,TalkRoomModel *roomList, NSError *error))block withToken:(NSString *)token andChartId:(NSInteger) chartId andUserIds:(NSString *) userIds;

//--删除聊天室
+ (NSURLSessionDataTask *)deleteClazzChart:(void (^)(BOOL result,NSError *error))block withToken:(NSString *)token andChartId:(NSInteger) chartId;
//--退出聊天室和请假条
+ (NSURLSessionDataTask *)leaveChart:(void (^)(BOOL result,NSError *error))block withToken:(NSString *)token andChartId:(NSInteger) chartId;
//--获取聊天室成员
+ (NSURLSessionDataTask *)getChartUsers:(void (^)(BOOL result,NSMutableArray *userList,NSError *error))block withToken:(NSString *)token andChartId:(NSInteger) chartId;
//--发送聊天信息
+ (NSURLSessionDataTask *)sendMsg:(void (^)(BOOL result,NSError *error))block andChartId:(NSInteger) chartId andReceiverId:(NSInteger) receiverId andContent:(NSString *)content;
//--发送图片聊天信息
+ (NSURLSessionDataTask *)sendImg:(void (^)(BOOL result,NSError *error))block andChartId:(NSInteger) chartId andReceiverId:(NSInteger) receiverId andContent:(NSString *)content;

@end

@interface TalkRoomModel : JSONModel

@property (nonatomic, assign) int       id;
@property (nonatomic, retain) NSString  * content;
@property (nonatomic, assign) int       type;
@property (nonatomic, retain) NSString  * title;

@property (nonatomic, strong) NSArray *chart_users;
@property (nonatomic, strong) NSArray *invite_join_users;
@end

@interface TalkUserModel : JSONModel

@property (nonatomic, assign) int       id;
@property (nonatomic, retain) NSString  *nickname;
@property (nonatomic, assign) int       is_creator;
@property (nonatomic, assign) int       is_admin;
@property (nonatomic, assign) int       is_master;

@end